<template>
  <div class="home-container">
    <div class="time-display">当前时间：{{ currentTime }}</div>
    <el-card class="welcome-card">
      <h1 class="title">欢迎进入象物核管理系统</h1>
      <p class="subtitle">高效、便捷、安全的医疗病例管理体验</p>
      <el-divider></el-divider>
      <p class="description">
        通过本系统，您可以轻松管理患者病例、提升医疗服务质量，提高工作效率。
      </p>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "WelcomePage",
  data() {
    return {
      currentTime: this.getCurrentTime()
    };
  },
  methods: {
    getCurrentTime() {
      const now = new Date();
      return now.toLocaleString();
    },
    updateTime() {
      this.currentTime = this.getCurrentTime();
    }
  },
  mounted() {
    this.timer = setInterval(this.updateTime, 1000);
  },
  beforeDestroy() {
    clearInterval(this.timer);
  }
};
</script>

<style scoped lang="scss">
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #667eea, #304156);
  padding: 20px;
  position: relative;
}

.time-display {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

.welcome-card {
  text-align: center;
  padding: 40px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  max-width: 500px;
}

.title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
}

.subtitle {
  font-size: 22px;
  color: #555;
  margin-top: 10px;
}

.description {
  font-size: 16px;
  color: #666;
  margin-top: 20px;
}

.enter-btn {
  margin-top: 25px;
  width: 100%;
}
</style>